From: Jasper St. Pierre Date: Thu, 14 Feb 2013 22:09:31 +0000 (-0500) Subject: networkAgent: Don't register/unregister, just refuse to handle requests X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~4842 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=24984458de595e1af1ed6970ab1f83ca48483086;p=gnome-shell.git networkAgent: Don't register/unregister, just refuse to handle requests https://bugzilla.gnome.org/show_bug.cgi?id=693746 --- diff --git a/js/ui/components/networkAgent.js b/js/ui/components/networkAgent.js index e214cd87c..13f9e3195 100644 --- a/js/ui/components/networkAgent.js +++ b/js/ui/components/networkAgent.js @@ -587,18 +587,19 @@ const NetworkAgent = new Lang.Class({ Name: 'NetworkAgent', _init: function() { - this._native = new Shell.NetworkAgent({ auto_register: false, - identifier: 'org.gnome.Shell.NetworkAgent' }); + this._native = new Shell.NetworkAgent({ identifier: 'org.gnome.Shell.NetworkAgent' }); this._dialogs = { }; this._vpnRequests = { }; this._native.connect('new-request', Lang.bind(this, this._newRequest)); this._native.connect('cancel-request', Lang.bind(this, this._cancelRequest)); + + this._enabled = false; }, enable: function() { - this._native.auto_register = true; + this._enabled = true; }, disable: function() { @@ -612,12 +613,15 @@ const NetworkAgent = new Lang.Class({ this._vpnRequests[requestId].cancel(true); this._vpnRequests = { }; - this._native.auto_register = false; - if (this._native.registered) - this._native.unregister(); + this._enabled = false; }, _newRequest: function(agent, requestId, connection, settingName, hints, flags) { + if (!this._enabled) { + agent.respond(requestId, Shell.NetworkAgentResponse.USER_CANCELED); + return; + } + if (settingName == 'vpn') { this._vpnRequest(requestId, connection, hints, flags); return;